#ifndef VTK_CROSSLINE_H
#define VTK_CROSSLINE_H

#include <QObject>

#include "img_file.h"

#include <vtkLineSource.h>
#include <vtkDataSetMapper.h>
#include <vtkActor.h>
#include <vtkAppendPolyData.h>
#include <vtkProperty.h>

class vtk_CrossLine : public QObject
{
    Q_OBJECT
private:
    double center[3] {1000.0, 0.0, 1000.0};
    double height{0.0}, width{0.0};
    double color[3] {1, 1, 1};
    float lineWidth{1};
    const unsigned short type;
    vtkSmartPointer<vtkLineSource> vline;//垂直线
    vtkSmartPointer<vtkLineSource> hline;//水平线
    vtkSmartPointer<vtkAppendPolyData> cross;//十字线
    vtkSmartPointer<vtkDataSetMapper> mapper;
    vtkSmartPointer<vtkActor> actor;

public:
    vtk_CrossLine(unsigned short _type = 0);
    void setCenter(double _center[3]);
    void setCenter(double _wx, double _wy);
    void setSize(const img_Info * info);
    void setSize(double _height, double _width);
    void setColor(double _r, double _g, double _b);
    void setLineWidth(float _lw);
    void getCenter(double _center[3]);
    vtkActor * getActor();
};

#endif // VTK_CROSSLINE_H
